{template 'common/header'}
<ul class="nav nav-tabs">
    <li class="active"><a href="#">模板管理</a></li>
    <li class=""><a href="{php echo $this->createWebUrl("templateset_edit", array("id" => 0));}">新增模板</a></li>
</ul>
<div class="panel panel-info">
    <div class="panel-heading">筛选</div>
    <div class="panel-body">
        <form action="" method="post" class="form-horizontal" role="form">
            <input type="hidden" name="c" value="site" />
            <input type="hidden" name="a" value="entry" />
            <input type="hidden" name="m" value="q_3354988381_notify" />
            <input type="hidden" name="do" value="notifyset" />
            {if $_GET['id'] != ''}
            <input type="hidden" name="id" value="{$_GET['id']}" />
            {else}
            <input type="hidden" name="id" value="{$_GET['rid']}" />
            {/if}
              
            <div class="form-group">
                <label class="col-xs-12 col-sm-2 col-md-2 col-lg-1 control-label" >模板名称</label>
                <div class="col-sm-8 col-lg-9">
                    <input class="form-control" name="template_name" id="template_name" type="text" value="{$_GPC['template_name']}">
                </div>
                <div class=" col-xs-12 col-sm-2 col-lg-2">
                    <button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
                </div>
            </div>
            <div class="form-group">
            </div>
        </form>
    </div>
  </div>
  
    <div style="padding:15px;">
        <table class="table table-hover">
            <thead class="navbar-inner">
                <tr>
                    <th>ID</th>
                    <th>模板ID</th>
                    <th>模板名称</th>
                    <th>操作</th>
                </tr>
            </thead>
  
            <tbody>
                {loop $list $row}
                <tr>
                    <td><small>{$row['id']}</small></small></td>
                    <td><small>{$row['template_id']}</small></small></td>
                    <td><small>{$row['template_name']}</small></small></td>
                    <td>
                        <a href='{php echo $this->createWebUrl("templateset_edit", array("id" => $row[id]));}' title="编辑" class="btn btn-primary btn-sm">查看</a>
                        <a href="javascript:void(0);" onclick="delete_templateset({$row['id']})" title="删除" class="btn btn-danger btn-sm">删除</a>
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
        {$pager}
    </div>
    
	<script>
	    //删除
	    function delete_templateset(tpl_id){
	    	if(confirm('确定删除')){
		    	$.post(
		    			'{php echo $this->createWebUrl("DeleteTemplatesetAjax")}',
		    	        {"tpl_id":tpl_id},
		    	        function (data){
		    	        	location.reload();
		    	        }
		    	);
	    	}	
	    }
	</script>
{template 'common/footer'}